package com.redeemer150.oj.judge.codesanbox.impl;


import com.redeemer150.oj.judge.codesanbox.CodeSandbox;
import com.redeemer150.oj.judge.codesanbox.model.ExecuteCodeRequest;
import com.redeemer150.oj.judge.codesanbox.model.ExecuteCodeResponse;
import com.redeemer150.oj.judge.codesanbox.model.JudgeInfo;
import com.redeemer150.oj.model.enums.JudgeInfoMessageEnum;
import com.redeemer150.oj.model.enums.QuestionSubmitStatusEnum;

import java.util.List;

/**
 * @author 黄宽亮
 * @version 1.0
 * @description: TODO
 * @date 2025/5/19 16:46
 */
public class ExampleCodeSandbox implements CodeSandbox {
    @Override
    public ExecuteCodeResponse executeCode(ExecuteCodeRequest executeCodeRequest){
        List<String> inputList = executeCodeRequest.getInputList();
        ExecuteCodeResponse executeCodeResponse = new ExecuteCodeResponse();
        executeCodeResponse.setOutputList(inputList);
        executeCodeResponse.setMessage("测试执行成功");
        executeCodeResponse.setStatus(QuestionSubmitStatusEnum.SUCCESS.getValue());
        JudgeInfo judgeInfo = new JudgeInfo();
        judgeInfo.setMessage(JudgeInfoMessageEnum.ACCEPT.getText());
        judgeInfo.setMemory(100L);
        judgeInfo.setTime(100L);
        executeCodeResponse.setJudgeInfo(judgeInfo);
        return executeCodeResponse;
    }

}
